﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace Dsl.Ped.Common.Converters
{
    /// <summary>
    /// Converts the <see cref="Boolean"/> value into its negative
    /// </summary>
    public class NegatedBoolConverter : IValueConverter
    {
        #region Implementation of IValueConverter

        /// <summary>
        /// Converts the <see cref="Boolean"/> value into its negative
        /// </summary>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool original = (bool)value;
            return !original;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool original = (bool)value;
            return !original;
        }

        #endregion
    }
}
